<% cid = CInt(Request.QueryString("cid")) pageno = CInt(Request.QueryString("pageno")) If pageno = 0 Then pageno = 1 End If Set conn = Server.CreateObject("ADODB.Connection") conn.Open MM_Connect sql = "Select CatName From Category Where CatID="&cid set rs = conn.Execute(sql) catname = rs("CatName") rs.Close set rs = nothing statuslink = ""&catname&"" %> ITAG Shopping Cart

<% sql = "Select SubCatName,SubCatID From SubCategory Where (SubCatLive=True) And (CatID="&cid &")" set rs = Server.CreateObject("ADODB.Recordset") rs.Open sql,conn,1,3 On Error Resume Next If rs.RecordCount > 0 Then %> <% End If %>

Home > <%=statuslink%>

<% Do While Not rs.Eof Response.Write("") Response.Write("") rs.MoveNext Loop rs.Close set rs = nothing %>
Sub Categories:
- "&rs("SubCatName")&"

<% sql = "Select ProName,ProImages, ProImageL,ProID,ProDescription,ProPrice,ProDiscount From Product Where CatID="&cid &" Order By ProID Desc" set rs = Server.CreateObject("ADODB.Recordset") rs.Open sql,conn,1,3 rs.pagesize=10 total = rs.RecordCount totalpage = rs.PageCount rs.AbsolutePage = pageno firstpage = 1 lastpage = totalpage previouspage = (pageno - 1) Nextpage = (pageno +1) For a=1 to rs.PageSize If rs.EOF Then Exit For %> <% rs.MoveNext Next rs.Close set rs = nothing %>
<%=rs("ProName")%>
">" border="0"> <%=Left(rs("ProDescription"),250)%> > ...

">More detail

<% If rs("ProDiscount") = 0 Then Response.Write("ราคา: "&FormatNumber(rs("ProPrice"))&" "&rate) Else Response.Write("ราคา: "&FormatNumber(rs("proprice"))&" "&rate&"
") Response.Write("ราคาพิเศษ: "&FormatNumber(rs("prodiscount"))&" "&rate) End If %>


">



  <%If pageno <> 1 and pageno <> 2 Then %> <<First | <% End If %> <%If pageno <> 1 Then %> <Previous | <% End if %> <% For b =1 To totalpage %> <% If b = pageno Then %> [<%=b%>] <% Else %> <%=b%> <%End If %> <%If b <> totalpage Then%> | <%End If %> <% Next %> <%If pageno <> totalpage Then %> | Next> <% End If %> <%If pageno <> totalpage And pageno <> totalpage-1 Then %> | Last>> <% End If %>



<% conn.Close set conn = nothing %>